<?php use_helper("I18N", "JavascriptBase") ?>
<div id="dp-header">
    <div id="dp-header-top">
        <div id="dp-header-top-inner">
            <div id="logged-in" class="inline-block">
                <div id="logged-in-inner">
                    <div id="photo-small" class="inline-block">
                        <?php include_partial("profile/photo", array("user" => $sf_user->getDpUser(), 'height' => 24)) ?>
                    </div>
                    <div id="fullname" class="inline-block">
                        <?php echo $sf_user ?>
                    </div>
                    <div id="sign-out" class="inline-block">
                        <a href="/profile-sign-out">Sign out</a>
                    </div>
                </div>
                <div id="dropdown" class="dropdown" style="visibility: hidden;">
                    <div class="dropdown-inner">
                        <div id="photo-big" class="inline-block">
                            <?php include_partial("profile/photo", array("user" => $sf_user->getDpUser(), 'height' => 24)) ?>
                        </div>
                        <div id="vertical-menu" class="inline-block">
                            <ol class="links">
                                <?php $i = 0; ?>
                                <?php foreach ($menu as $route => $item): ?>
                                    <?php $show = in_array(strtolower($sf_user->getType()), $item["credentials"]) ?>
                                    <?php if ($show): ?>
                                        <li class="link">
                                            <?php $params = array() ?>
                                            <?php $iParams = isset($item["param"]) ? explode('&', $item["param"]) : array(); ?>
                                            <?php foreach ($iParams as $iParam): ?>
                                                <?php $params[$iParam] = $itemParams[$iParam] ?>
                                            <?php endforeach; ?>
                                            <?php echo link_to2(__($item["label"]), $route, $params, array('class' => $sf_user->getCurrentRoute("notset") == $route ? 'current' : "")) ?>
                                            <?php $i++; ?>
                                        </li>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="dp-header-middle">
        <div id="dp-header-middle-inner">
            <div id="dp-logo-logged-in">
                <a href="/" title="DocPlus Home">
                    <?php echo image_tag("/images/dp_logo_small.png", array("alt" => "People caring for people, is what we do best!")) ?>
                </a>
            </div>
            <div id="dp-navigation-logged-in">
                <ul id="logged-in-menu" class="inline-block">
                    <?php $i = 0; ?>
                    <?php foreach ($menu as $route => $item): ?>
                        <?php $show = in_array(strtolower($sf_user->getType()), $item["credentials"]) ?>
                        <?php if ($i > 0 && $show): ?>
                            <li>|</li>
                        <?php endif; ?>
                        <?php if ($show): ?>
                            <li>
                                <?php $params = array() ?>
                                <?php $iParams = isset($item["param"]) ? explode('&', $item["param"]) : array(); ?>
                                <?php foreach ($iParams as $iParam): ?>
                                    <?php $params[$iParam] = $itemParams[$iParam] ?>
                                <?php endforeach; ?>
                                <?php echo link_to2(__($item["label"]), $route, $params, array('class' => $sf_user->getCurrentRoute("notset") == $route ? 'current' : "")) ?>
                            </li>   
                            <?php $i++; ?>
                        <?php endif; ?>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
    </div>
</div>